﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <h2>Detail View Page</h2>
    <div ng-controller="CollegeController">
        <div>
            <table class="table table-bordered table-striped">
                <tr>
                    <th>Name</th>
                    <th>City</th>
                    <th>State</th>
                    <th>Rating (1 - 5)</th>
                    <th></th>

                </tr>
                <tr>
                    <td>
                        <span ng-hide="editing">
                            {{college.Name}}
                        </span>
                        <input type="text" ng-model="college.Name" ng-hide="!editing" />
                    </td>
                    <td>
                        <span ng-hide="editing">
                            {{college.City}}
                        </span>
                        <input type="text" ng-model="college.City" ng-hide="!editing" />
                    </td>
                    <td>
                        <span ng-hide="editing">
                            {{college.State}}
                        </span>
                        <input type="text" ng-model="college.State" ng-hide="!editing" />
                    </td>
                    <td>{{college.AvgRating}}</td>
                    <td>
                        <button ng-click="editing=true" ng-hide="editing">Edit</button>
                        <button ng-click="deleteCollege(college.CollegeId);" ng-hide="editing">Delete</button>
                        <button ng-click="editing=false; saveCollege(college);" ng-hide="!editing">Save</button>
                        <button ng-click="editing=false; getColleges();" ng-hide="!editing">Cancel</button>
                    </td>
                </tr>
            </table>
            <div>
                <h2>College Ratings</h2>
                <table class="table table-bordered table-striped">
                    <tr>
                        <th>Review</th>
                        <th>Numeric Rating (1 - 5)</th>
                        <th></th>
                    </tr>
                    <tr ng-repeat="review in reviews">
                        <td>{{review.Text}}</td>
                        <td>{{review.NumRating}}</td>
                        <th></th>
                    </tr>
                    <tr>
                        <td><input type="text" ng-model="review.Text" /></td>
                        <td><input type="text" ng-model="review.NumRating" /></td>
                        <td><button ng-click="addReview(review);">Submit Rating</button></td>
                    </tr>
                </table>
  
  
            </div>
             

        </div>
        
    </div>
</body>
</html>
